package com.jhws.business.customer.bo;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * 每个支付客户的一些私密信息，包括appid, 秘钥, 商户号等
 */
@Entity
@Table(name="customers_pay_secret")
@DynamicUpdate(true)
@DynamicInsert(true)
public class PayCustomerSecret {
    public PayCustomerSecret() {
    }

    public PayCustomerSecret(Long id,String mchId, String appId,String creator, String time) {
        this.id = id;
        this.mchId = mchId;
        this.creator = creator;
        this.time = time;
        this.appId = appId;
    }

    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    /* 支付客户的id */
    @Column(name = "custom_id")
    private Long customId;

    /* app id 或者 公众号 id 等 */
    @Column(name = "app_id")
    private String appId;

    /* 商户号 */
    @Column(name = "mch_id")
    private String mchId;

    /* 微信API秘钥/支付宝私钥 */
    @Column(name = "secret",columnDefinition = "text")
    private String secret;

    /* 微信公众号私钥/支付宝公钥 */
    @Column(name = "secret2",columnDefinition = "text")
    private String secret2;

    /* 微信公众号授权后拿到的刷新token,可以用此来调用客户公众号的API(需要定制客户公众号才需要,仅支付不需要) */
    @Column(name = "wx_gzh_refresh_token")
    private String wxGzhRefreshToken;

    /* 客户类型 ,weixin app, 公众号，支付宝等*/
    @Column(name = "type")
    private String type;

    private String creator;

    /* 创建时间 */
    private String time;

    /* 状态, 0 表示正常， 1 表示需要家和操作 */
    private Integer state;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getCustomId() {
        return customId;
    }

    public void setCustomId(Long customId) {
        this.customId = customId;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getMchId() {
        return mchId;
    }

    public void setMchId(String mchId) {
        this.mchId = mchId;
    }

    public String getSecret() {
        return secret;
    }

    public void setSecret(String secret) {
        this.secret = secret;
    }

    public String getSecret2() { return secret2; }

    public void setSecret2(String secret2) { this.secret2 = secret2; }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getWxGzhRefreshToken() {
        return wxGzhRefreshToken;
    }

    public void setWxGzhRefreshToken(String wxGzhRefreshToken) {
        this.wxGzhRefreshToken = wxGzhRefreshToken;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }
}
